package com.bawei.lib_common.widget

import android.content.Context
import android.util.AttributeSet
import androidx.recyclerview.widget.RecyclerView
import com.bawei.lib_common.R
import com.bawei.lib_common.dp

/**
 *作者：lxy
 *功能:
 *时间：2025/5/29
 */
class MaxRecyclerView:RecyclerView {

    private var mMaxHeight = 210.dp

    constructor(context: Context) : super(context) {}
    constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
        init(context, attrs)
    }

    constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
        init(context, attrs)
    }

    private fun init(context: Context, attrs: AttributeSet?) {
        val arr = context.obtainStyledAttributes(attrs, R.styleable.MaxRecyclerView)
        mMaxHeight = arr.getLayoutDimension(R.styleable.MaxRecyclerView_customMaxHeight, mMaxHeight)
        arr.recycle()
    }

}